/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package td1;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;

import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import javax.swing.GroupLayout;
import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextPane;

/**
 * Boite de dialogue "A propos de..." fournissant des renseignement sur l'auteur
 * @author saluzzo
 */
public class DialogueAProposDe extends JDialog implements WindowListener {

    public void windowActivated(WindowEvent e) {
    }

    public void windowClosed(WindowEvent e) {
    }

    public void windowClosing(WindowEvent e) {
        this.getParent().setEnabled(true);
        ((JFrame)this.getParent()).toFront();
    }

    public void windowDeactivated(WindowEvent e) {
    }

    public void windowDeiconified(WindowEvent e) {
    }

    public void windowIconified(WindowEvent e) {
    }

    public void windowOpened(WindowEvent e) {
    }

    public DialogueAProposDe(JFrame parent) {
        super(parent);
        this.setTitle("A Propos de...");
        this.addWindowListener(this);
        this.setContentPane(new JPanel());
        this.setLayout(new BorderLayout());
        GroupLayout LayoutAproposde = new GroupLayout(this.getContentPane());
        this.getContentPane().setLayout(LayoutAproposde);
        LayoutAproposde.setAutoCreateGaps(true);
        LayoutAproposde.setAutoCreateContainerGaps(true);

        Logo = new JLabel(new ImageIcon("icon.png"));
        TextePrincipal = new JLabel("Dessin Vectoriel JAVA");
        TexteSecondaire = new JTextPane();
        TexteSecondaire.setText("Vincent SALUZZO\n" +
                "INFRES 2009-2012 - 1ère Année");
        TexteSecondaire.setEditable(false);
        TexteSecondaire.setBackground(TextePrincipal.getBackground());
        TextePrincipal.setFont(new Font("Arial", Font.BOLD, 14));

        LayoutAproposde.setHorizontalGroup(
                LayoutAproposde.createSequentialGroup().
                    addComponent(this.Logo).
                    addGroup(LayoutAproposde.createParallelGroup().
                    addComponent(this.TextePrincipal).
                    addComponent(this.TexteSecondaire)));
        LayoutAproposde.setVerticalGroup(
                LayoutAproposde.createParallelGroup().
                    addComponent(this.Logo).
                    addGroup(LayoutAproposde.createSequentialGroup().
                    addComponent(this.TextePrincipal).
                    addComponent(this.TexteSecondaire)));
        this.pack();
        this.getParent().setEnabled(false);
    }

    JPanel EspaceLogo;
    JLabel Logo;
    JLabel TextePrincipal;
    JTextPane TexteSecondaire;


}
